﻿<UserControl x:Class="Freshome.m.vws.ClosableTop"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:f="clr-namespace:Freshome.m.vws"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <f:Bool2Visible x:Key="b2v" />
        <DrawingImage x:Key="heftyFork">
            <DrawingImage.Drawing>
                <GeometryDrawing Geometry="F1 M2,2 L3,2 L11,10 L11,11 L10,11 L2,3 M2,11 L2,10 L10,2 L11,2 L11,3 L3,11 Z" Brush="#ff11">
                </GeometryDrawing>
            </DrawingImage.Drawing>
        </DrawingImage>
        <DrawingImage x:Key="lightFork">
            <DrawingImage.Drawing>
                <GeometryDrawing Geometry="F1 M2,2 L3,2 L11,10 L11,11 L10,11 L2,3 M2,11 L2,10 L10,2 L11,2 L11,3 L3,11 Z" Brush="#9f66">
                </GeometryDrawing>
            </DrawingImage.Drawing>
        </DrawingImage>
        <Style x:Key="buttonImage" TargetType="{x:Type Image}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding}" Value="True">
                    <Setter Property="Source" Value="{StaticResource heftyFork}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding}" Value="False">
                    <Setter Property="Source" Value="{StaticResource lightFork}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <DockPanel Width="60" LastChildFill="True">
        <Button x:Name="tabutton" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" DockPanel.Dock="Right">
            <Image x:Name="closeImg" Style="{StaticResource buttonImage}" Stretch="None"
                   DataContext="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" />
        </Button>
        <TextBlock x:Name="tabrief" Text="{Binding Path=Name}"></TextBlock>
    </DockPanel>
</UserControl>
